<!DOCTYPE html>
<html>
<head lang="en">
	<meta charset="UTF-8">
	<title>基于HTML5的仿腾讯UI的图片上传</title>

	<!-- select2 -->
	<link rel="stylesheet" type="text/css" href="http://www.herosphp.my/res/framework/css/select2.css" />
	<!-- common css-->
	<link rel="stylesheet" type="text/css" href="TUpload/css/upload.css" />
</head>

<body style="background: #424f63">

	<div style="padding:100px;">
		<button id="upload-btn" style="padding: 10px 20px;">上传图片</button>
		<div id="image-box">

		</div>
	</div>

	<script src="TUpload/jquery.js"></script>
	<script type="text/javascript" src="TUpload/TUpload.js"></script>

	<script type="text/javascript">

		$('#upload-btn').on('click', function() {
			new TUpload({
				uploadUrl : "upload.php",
				maxFileSize : 1024,
				maxFileNum : 20,
				callback : function(data) {
					$.each(data, function(idx, item) {
						$("#image-box").append('<img src="'+item+'" width="200" />');
					});
					console.log(data);
				}
			});
		});

	</script>
</body>
</html>